import type {RouteRecordRaw} from 'vue-router';

import {
    JCX_DOC_URL,
    JCX_ELE_PREVIEW_URL,
    JCX_GITHUB_URL,
    JCX_LOGO_URL,
    JCX_NAIVE_PREVIEW_URL,
} from '@/constants';

import {BasicLayout, IFrameView} from '@/layouts';
import {$t} from '@/locales';

const routes: RouteRecordRaw[] = [
    {
        component: BasicLayout,
        meta: {
            badgeType: 'dot',
            icon: JCX_LOGO_URL,
            order: 9999,
            title: $t('demos.jcx.title'),
        },
        name: 'JcxProject',
        path: '/jcx-admin',
        children: [
            {
                name: 'JcxAbout',
                path: '/jcx-admin/about',
                component: () => import('@/views/_core/about/index.vue'),
                meta: {
                    icon: 'lucide:copyright',
                    title: $t('demos.jcx.about'),
                },
            },
            {
                name: 'JcxDocument',
                path: '/jcx-admin/document',
                component: IFrameView,
                meta: {
                    icon: 'lucide:book-open-text',
                    link: JCX_DOC_URL,
                    title: $t('demos.jcx.document'),
                },
            },
            {
                name: 'JcxGithub',
                path: '/jcx-admin/github',
                component: IFrameView,
                meta: {
                    icon: 'mdi:github',
                    link: JCX_GITHUB_URL,
                    title: 'Github',
                },
            },
            {
                name: 'JcxNaive',
                path: '/jcx-admin/naive',
                component: IFrameView,
                meta: {
                    badgeType: 'dot',
                    icon: 'logos:naiveui',
                    link: JCX_NAIVE_PREVIEW_URL,
                    title: $t('demos.jcx.naive-ui'),
                },
            },
            {
                name: 'JcxElementPlus',
                path: '/jcx-admin/ele',
                component: IFrameView,
                meta: {
                    badgeType: 'dot',
                    icon: 'logos:element',
                    link: JCX_ELE_PREVIEW_URL,
                    title: $t('demos.jcx.element-plus'),
                },
            },
        ],
    },
];

export default routes;
